package cm.mefobe.android.telecomcost.entities;
import android.text.format.*;

public class DailyThreshold extends DayRangeThreshold {
	
	private Day _day;	

	public DailyThreshold(double d,Day day) {
		super(d,day);	
		_day = day;
	}

	public DailyThreshold() {			
	}

	@Override
	public String getType() {		
		return PROP_TYPE;
	}
	
	@Override
	public void setType(String type) {		
	}

	public void setDay(Day day) {
		this._day = day;
	}

	public Day getDay() {
		return _day;
	}
	
	@Override
	public String toString() {
		return _day.toString() + " ( " + getAmount() + " )";
	}
	
	public static final String PROP_TYPE = "DailyThreshold";

	public CharSequence getDayNameLong() {		
		return DateUtils.getDayOfWeekString(_day.getDayOfWeek(),DateUtils.LENGTH_LONG);
	}
	
	public CharSequence getDayNameShort() {		
		return DateUtils.getDayOfWeekString(_day.getDayOfWeek(),DateUtils.LENGTH_SHORT);
	}

	public void setWeekOfMonth(int _weekOfMonth) {
		this._day.setWeekOfMonth(_weekOfMonth);
	}

	public int getWeekOfMonth() {
		return _day.getWeekOfMonth();
	}

	public void setMonthOfYear(int _monthOfYear) {
		this._day.setMonthOfYear(_monthOfYear);
	}

	public Month getMonth() {
		return new Month(_day.getMonthOfYear());
	}

	@Override
	public int hashCode() {
		return _day.hashCode();
	}
}
